{% extends 'website/base.html' %}
{% load static %}
{% block title %}后台管理{% endblock %}
{% block extarnal_header %}
    <link rel="stylesheet" type="text/css" href="{% static 'css/dashboard.css' %}">
    <script type="text/javascript" src="{% static 'js/jquery.form.js' %}"></script>
    <script type="text/javascript" src="{% static 'kindeditor/kindeditor-all-min.js' %}"></script>
    <script type="text/javascript" src="{% static 'kindeditor/lang/zh-CN.js' %}"></script>
{% endblock %}
{% block body %}
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapse" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand"  href="#">后台管理</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav navbar-right">
                    {% if user.is_authenticated %}
                        <li><a href="{% url 'homepage' %}">前台主页</a></li>
                        <li><a href="#">{{ user.username }}</a></li>
                        <li><a href="{% url 'user-logout' %}">注销并退出后台</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-3 col-md-2 sidebar">
                {% include 'website/backend/nav.html' %}
            </div>
            <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
                <h1 class="page-header">{% block option-title %}{% endblock %}</h1>
                <div class="row placeholders">
                    {% block content %}{% endblock %}
                </div>
            </div>
        </div>
    </div>

{% endblock %}
{% block extranal_js %}
    <script>
        $('#{{ active_page }}').addClass("active")
    </script>
    {% block js %}{% endblock %}
{% endblock %}
